Routers
---

Routers are used to request the api.

How to create a Router
----

Create ``./app/routers/myRouter.js`` where myRouter is the name of the router.

```javascript
/**
 * Filename should be camelcase, while
 * classname should be PascalCase.
 *
 * @file myRouter
 */
 const Router = require("./router");
 
 class MyRouter extends Router {
    /**
     *  @constructor
     */ 
     constructor(url) {
        super(url);
    };
    
    /**
     * Fetch a list of the given url.
     *
     * @method requestAll
     * @return {Promise} list 
    */
    requestAll() {
        super.requestAll();
    }
    
    /**
     * Fetch an item of the given url.
     *
     * @method requestOne
     * @param {string|number} property
     * @return {Promise} 
     */
    requestOne(property) {
        super.requestOne(property);
    }
 } 
```

You can now instanciate it:

```javascript
const MyRouter = require("./app/routers/myRouter");

let myRouter = new MyRouter("pet");
// Get a pet
myModel.requestOne(1)
    .then(payload => console.log(payload));
```